﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SelectQuotes.aspx.cs" Inherits="TotalSport.SelectQuotes" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ Register Src="~/Header.ascx" TagName="header" TagPrefix="uc" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>::All Quotes::</title>
    <link href="Styles/Stylsheet.css" rel="stylesheet" type="text/css" />
    <link href="Styles/Popup.css" rel="stylesheet" type="text/css" />
    <script src="Scripts/jquery-1.4.1-vsdoc.js" type="text/javascript"></script>
    <script src="Scripts/jquery-1.4.1.js" type="text/javascript"></script>
    <script src="Scripts/jquery-1.4.1.min.js" type="text/javascript"></script>
    <script src="Scripts/jquery-1.3.2.js" type="text/javascript"></script>
    <script src="Scripts/jquery-1.4.2.min.js" type="text/javascript"></script>
    <script src="Scripts/jquery-ui-1.7.2.custom.min.js" type="text/javascript"></script>
    <script type="text/javascript">

        $(document).ready(function () {
            // Tabs
            $('#tabs').tabs({ selected: 0 });
            $('#tabs').bind('tabsshow', function (event, ui) {
                var tabSelected = "#tab" + ui.index + "Selected";
                $(tabSelected).html("isClicked");
            });

            $('#aa_lnkShowallQuote').css({ color: '#FF0001' });


        });
    </script>
    <style type="text/css"> 
        .style3
        {
            width: 554px;
        }
    </style>
    <script type="text/javascript">
        function ISNumber(Value) {
            var reg = /^([0-9]{1,5})$/;
            if (reg.test(Value) == false)
            { return false; }
            else {
                return true;
            }
        }

        function ISChar(Value) {
            var reg = /^([a-zA-Z _]{0,100})$/;
            if (reg.test(Value) == false)
            { return false; }
            else {
                return true;
            }
        }



        function SetLenght() {
            var txtSearch = document.getElementById("txtSearch");
            var QuoteID = document.getElementById("rblsearch_0");
            var name = document.getElementById("rblsearch_1");
            var CompanyName = document.getElementById("rblsearch_2");
            if (QuoteID.checked) {
                txtSearch.maxLength = "5";
            }
            if (name.checked) {
                txtSearch.maxLength = "50";
            }
            if (CompanyName.checked) { txtSearch.maxLength = "50"; }
        }

        function Check() {
            var QuoteID = document.getElementById("rblsearch_0");
            var name = document.getElementById("rblsearch_1");
            var CompanyName = document.getElementById("rblsearch_2");
            var txtSearch = document.getElementById("txtSearch");
            var strValue = txtSearch.value;
            //alert(strValue);
            if (strValue == "") {

                document.getElementById("spanMsg").style.display = "block";
                document.getElementById("spanMsg").innerHTML = "Please enter search text.";
                //Clear();

                return false;
            }
            if (strValue != "") {

                if (QuoteID != null && name != null && CompanyName != null) {
                    //alert(ID.checked);
                    if (QuoteID.checked) {

                        if (!ISNumber(strValue)) {

                            //alert(strValue.lenght);
                            document.getElementById("spanMsg").style.display = "block";
                            document.getElementById("spanMsg").innerHTML = "Please enter valid ID.";
                            return false;

                        }

                    }
                    if (name.checked) {

                        if (!ISChar(strValue)) {
                            // alert("history");
                            document.getElementById("spanMsg").style.display = "block";
                            document.getElementById("spanMsg").innerHTML = "Please enter characters.";
                            return false;
                        }

                    }
                    if (CompanyName.checked) {

                        if (!ISChar(strValue)) {
                            // alert("history");
                            document.getElementById("spanMsg").style.display = "block";
                            document.getElementById("spanMsg").innerHTML = "Please enter characters.";
                            return false;
                        }
                    }

                }
            }

        }
    </script>
</head>
<body>
    <form id="form2" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <center>
        <div>
            <uc:header runat="server" ID="aa" />
        </div>
    </center>
    <center>
        <br />
        <table>
            <tr>
                <td>
                    <table>
                        <tr>
                            <td>
                                <asp:Label ID="Label7" runat="server" Text=" Search:" CssClass="lableform"></asp:Label>
                            </td>
                            <td>
                                <asp:RadioButtonList ID="rblsearch" runat="server" RepeatDirection="Horizontal">
                                    <asp:ListItem Value="Quote ID" Selected="True">Quote ID</asp:ListItem>
                                    <asp:ListItem Value="Recipient Name">Recipient Name</asp:ListItem>
                                    <asp:ListItem Value="Company Name">Company Name</asp:ListItem>
                                </asp:RadioButtonList>
                            </td>
                            <td>
                                <asp:TextBox ID="txtSearch" runat="server" onfocus=" document.getElementById('spanMsg').style.display = 'none';SetLenght();">
                                </asp:TextBox>
                            </td>
                            <td>
                                <asp:Button ID="btnSearch" runat="server" Text="Search" OnClientClick="return Check();"
                                    OnClick="btnSearch_Click" />
                            </td>
                        </tr>
                        <tr>
                            <td colspan="4">
                                <span id="spanMsg" style="display: none; color: Red; padding-left: 380px;" runat="server">
                                </span>
                            </td>
                        </tr>
                    </table>
                </td>
                <td align="left">
                    <asp:Label ID="Label6" runat="server" Text=" Location:" CssClass="lableform"></asp:Label>
                    <asp:DropDownList ID="ddllocation" runat="server" SkinID="location" AutoPostBack="true"
                        CausesValidation="false" OnSelectedIndexChanged="ddllocation_SelectedIndexChanged">
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="upPnlCandidate">
                        <ProgressTemplate>
                            <center>
                                <div id="pageLoading">
                                    <center>
                                        <img src="Images/loading .gif" style="z-index: 5000; top: 50%; left: 50%; position: absolute;"
                                            alt="loading" />
                                        <div style="color: White; font-size: 18px; top: 50%; left: 50%;">
                                            Loading...
                                        </div>
                                    </center>
                                    <div id="transparentBg" class="transparentBg">
                                    </div>
                                </div>
                            </center>
                        </ProgressTemplate>
                    </asp:UpdateProgress>
                    <asp:UpdatePanel ID="upPnlCandidate" runat="server">
                        <ContentTemplate>
                            <table border="0" width="900px">
                                <tr>
                                    <td align="left" style="font-size: 11px; color: Red">
                                        <asp:Label ID="Label4" runat="server" Text="(Click on Particular Quote ID to View Quote Details)"></asp:Label>
                                    </td>
                                </tr>
                                <tr>
                                    <td valign="top" width="800px" align="center">
                                        <asp:GridView ID="grdQuotes" runat="server" AutoGenerateColumns="False" CellPadding="3"
                                            ForeColor="Black" GridLines="Vertical" AllowPaging="True" Width="900px" BorderColor="#999999"
                                            BorderWidth="1px" BackColor="White" BorderStyle="Solid" OnPageIndexChanging="grdQuotes_PageIndexChanging"
                                            PageSize="20" OnRowDataBound="grdQuotes_RowDataBound" DataKeyNames="refno">
                                            <AlternatingRowStyle BackColor="#DDE7FB" />
                                            <Columns>
                                                <asp:TemplateField HeaderText="Edit">
                                                    <ItemTemplate>
                                                        <asp:ImageButton ID="edit" ImageUrl="~/Images/Edit.png" runat="server" Width="25px"
                                                            Height="25px" OnClick="edit_Click" CausesValidation="false" CommandArgument='<%#bind("refno")%>' />
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                                <%--<asp:BoundField DataField="refno" HeaderText="Reference no" />--%>
                                                <%--  <asp:ButtonField   ButtonType="Image"  HeaderText="EDIT" ImageUrl="~/Images/Edit.png"
                                        Text="Button" CommandName="Edit"     >--%>
                                                <%--    <ControlStyle Width="30px" />
                                        <ItemStyle Height="10px" Width="30px" />--%>
                                                <asp:TemplateField HeaderText="Quote ID">
                                                    <ItemTemplate>
                                                        <asp:LinkButton ID="lnkrefID" runat="server" Text='<%# Bind("refno") %>' Font-Underline="true"
                                                            CommandArgument='<%# Bind("refno")%>' ForeColor="#2996F5" OnClick="lnkrefID_Click"></asp:LinkButton>
                                                    </ItemTemplate>
                                                    <ItemStyle Width="50px" />
                                                </asp:TemplateField>
                                                <asp:BoundField DataField="toname" HeaderText="Recipient Name">
                                                    <ItemStyle Width="150px" />
                                                </asp:BoundField>
                                                <asp:BoundField DataField="emailid" HeaderText="Email Id">
                                                    <ItemStyle Width="120px" />
                                                </asp:BoundField>
                                                <asp:BoundField DataField="Companyname" HeaderText="Company Name">
                                                    <ItemStyle Width="80px" />
                                                </asp:BoundField>
                                                <asp:BoundField DataField="CreationDate" HeaderText="Created On">
                                                    <ItemStyle Width="150px" />
                                                </asp:BoundField>
                                                <asp:TemplateField HeaderText="Invoice">
                                                    <ItemTemplate>
                                                        <asp:Label ID="invo" runat="server" Text='<%# Eval("Invoice") %>' Style="display: none"></asp:Label>
                                                        <%--  <a href="" id="invoice" runat="server" target="_blank" title='<%# Eval("refno")%>'>
                                                         </a>--%>
                                                        <%--<asp:LinkButton ID="Invoiceid" runat="server" Text='<%# Bind("Invoice") %>' Font-Underline="true"
                                                CommandArgument='<%# Bind("refno")%>' ForeColor="#2996F5"  CausesValidation="false" PostBackUrl=""
                                           >  </asp:LinkButton>--%>
                                                        <asp:Button ID="btninvoicecre" runat="server" OnClick="btninvoicecre_Click" Text="Create Invoice" />
                                                        <asp:Button ID="btneditinvoice" runat="server" Text="Edit Invoice" OnClick="btneditinvoice_Click" />
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                                <asp:TemplateField HeaderText="Download As" ItemStyle-Width="100px">
                                                    <ItemTemplate>
                                                        <%-- <asp:HyperLink></asp:HyperLink>--%>
                                                        <asp:HyperLink ID="imgpdf" Target="_blank" ImageUrl="~/Images/pdfdwnload.jpg" runat="server"
                                                            Width="25px" Height="25px" />
                                                        <asp:ImageButton ID="imgexcel" ImageUrl="~/Images/ExcelDownloadIcon.png" runat="server"
                                                            Width="25px" Height="25px" />
                                                        <%--  <asp:ImageButton ID="imgprint" ImageUrl="~/Images/printdownload.png" runat="server"
                                                            Width="30px" Height="30px" OnClick="window.print()" />--%>
                                                        <%--<a href="PDF/<%# Eval("refno")%>.html" onclick="window.print();return false">
                                                            <img src="~/Images/printdownload.png"></a>--%>
                                                    </ItemTemplate>
                                                    <ItemStyle Width="100px" />
                                                </asp:TemplateField>
                                            </Columns>
                                            <FooterStyle BackColor="#CCCCCC" />
                                            <HeaderStyle BackColor="#045E84" Font-Bold="True" ForeColor="White" />
                                            <PagerStyle BackColor="#999999" ForeColor="Black" HorizontalAlign="Center" />
                                            <SelectedRowStyle CssClass="gridSelectedRowStyle" BackColor="#FF9933" Font-Bold="True"
                                                ForeColor="White" />
                                            <SortedAscendingCellStyle BackColor="#F1F1F1" />
                                            <SortedAscendingHeaderStyle BackColor="#808080" />
                                            <SortedDescendingCellStyle BackColor="#CAC9C9" />
                                            <SortedDescendingHeaderStyle BackColor="#383838" />
                                        </asp:GridView>
                                        <!--modal view !-->
                                        <asp:Button ID="btnHiddenPerson" runat="Server" Style="display: none" />
                                        <asp:ModalPopupExtender ID="lnkView_ModalPopupExtender" runat="server" TargetControlID="btnHiddenPerson"
                                            CancelControlID="cancelBtnView" PopupControlID="pnlLnkView" BackgroundCssClass="modalBackground">
                                        </asp:ModalPopupExtender>
                                        <asp:Panel ID="pnlLnkView" runat="server" Style="overflow: scroll;" Height="500px">
                                            <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
                                                <ContentTemplate>
                                                    <table id="Table1" width="600px" class="ModalPopup" border="0" cellpadding="0" cellspacing="0"
                                                        runat="server" style="margin-left: 50px">
                                                        <tr>
                                                            <td colspan="4">
                                                                <div style="float: right">
                                                                    <img src="Images/newsletter_close.PNG" alt="close" runat="server" id="cancelBtnView" /></div>
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td colspan="4" class="headingpage" align="left">
                                                                <img src="Images/quoteicon.jpg" width="40px" height="40px" />
                                                                Quote Details
                                                                <hr />
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td align="left" style="color: #054287;">
                                                                Receipient Name :
                                                                <asp:Label ID="lblName" runat="server" Text="Label" Font-Bold="true"></asp:Label>
                                                            </td>
                                                            <td align="left" style="color: #054287;" width="300px">
                                                                Created By Id:
                                                                <asp:Label ID="lblcreatedby" runat="server" Text="Label" Font-Bold="true"></asp:Label>
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td align="left" style="color: #054287" class="style3" colspan="2">
                                                                Reference Number :
                                                                <asp:Label ID="lblrefeno" runat="server" Text="Label" Font-Bold="true"></asp:Label>
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td align="left" style="color: #054287" colspan="2">
                                                                Company Name :
                                                                <asp:Label ID="lblcompanyname" runat="server" Text="Label" Font-Bold="true"></asp:Label>
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td colspan="2">
                                                                <br />
                                                                <br />
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td colspan="2">
                                                                <table width="700px" border="1" style="background-color: #0070BA; color: White">
                                                                    <tr>
                                                                        <td width="75px" align="center">
                                                                            SR.No
                                                                        </td>
                                                                        <td align="center" width="400px">
                                                                            Particulars
                                                                        </td>
                                                                        <td width="70px" style="font-family: Rupee Foradian" align="center">
                                                                            Price
                                                                        </td>
                                                                        <td style="font-family: Rupee Foradian"  width="80px"; align="center">
                                                                            Discount Price
                                                                        </td>
                                                                      <%--  <td width="190px">
                                                                            New Discount
                                                                        </td>--%>
                                                                    </tr>
                                                                </table>
                                                            </td>
                                                        </tr>
                                                        <%-- <tr>
                                                <td>
                                                    Enter Email ID
                                                </td>
                                                <td>
                                                    <asp:TextBox ID="txtEmailid" runat="server"></asp:TextBox>
                                                </td>
                                            </tr>--%>
                                                        <tr>
                                                            <td colspan="2" style="background-color: #D3DAFB">
                                                                <asp:Repeater ID="rptQuot" runat="server" OnItemDataBound="rptQuot_ItemDataBound">
                                                                    <ItemTemplate>
                                                                        <table border="1" cellpadding="3" cellspacing="3" width="700px" style="border-color: #fff;">
                                                                            <tr>
                                                                                <td width="75px">
                                                                                    <asp:Label ID="lblsrno" runat="server" Text=""></asp:Label>
                                                                                </td>
                                                                                <td width="250px">
                                                                                    <asp:Label ID="Label1" runat="server" Text='<%# Bind("ParticularName") %>'></asp:Label>
                                                                                </td>
                                                                                <td width="100px">
                                                                                    <asp:Label ID="Label2" runat="server" Text='<%# Bind("BrandName") %>'></asp:Label>
                                                                                </td>
                                                                                <td width="50px">
                                                                                    <asp:Label ID="Label3" runat="server" Text='<%# Bind("ItemCode") %>'></asp:Label>
                                                                                </td>
                                                                                <td width="70px">
                                                                                    <asp:Label ID="lblPrice" runat="server" Text='<%# Bind("Price") %>'></asp:Label>
                                                                                </td>
                                                                                <td width="80px" style="font-weight: bold">
                                                                                    <asp:Label ID="lblScntprice" runat="server" Text='<%# Bind("DscoutPrice") %>'></asp:Label>
                                                                                    <input type="hidden" id="lblSubid" runat="server" value='<%# Eval("QuoteID") %>' />
                                                                                </td>
                                                                                <%--<td rowspan="2">
                                                                                    <asp:TextBox ID="txtdsctamt" runat="server" Width="180px" ClientIDMode="Predictable"></asp:TextBox>
                                                                                    <asp:TextBoxWatermarkExtender ID="TextBoxWatermarkExtender1" runat="server" TargetControlID="txtdsctamt"
                                                                                        WatermarkText="Enter Discount Rate Here" WatermarkCssClass="watermarked">
                                                                                    </asp:TextBoxWatermarkExtender>
                                                                                    <br />
                                                                                    <br />
                                                                                    <asp:Button ID="btnSubmit" runat="server" Text="Submit" OnClick="btnSubmit_Click" />
                                                                                </td>--%>
                                                                            </tr>
                                                                            <tr>
                                                                                <td width="75px" align="center">
                                                                                    <img src="Images/<%# Eval("Picture") %>" height="50" width="50" />
                                                                                </td>
                                                                                <td colspan="4">
                                                                                    <asp:Label ID="Label5" runat="server" Text='<%# Bind("Description") %>'></asp:Label>
                                                                                </td>
                                                                            </tr>
                                                                        </table>
                                                                    </ItemTemplate>
                                                                </asp:Repeater>
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td colspan="2" width="700px" align="left" style="padding-top: 30px">
                                                                <%-- <table style="border-color: White" width="400px" border="0">
                                                                    <tr style="padding-left: 0px; display: none; background-color: #F3C7C1" runat="server"
                                                                        id="tr1">
                                                                        <td align="right" width="200px">
                                                                            Total Price :
                                                                        </td>
                                                                        <td style="padding-left: 00px">
                                                                            <asp:Label ID="lblTotalPrice" runat="server" Text="Label" Style="font-family: Rupee Foradian;
                                                                                font-weight: bold"></asp:Label>
                                                                        </td>
                                                                    </tr>
                                                                    <tr style="display: none; background-color: #F3C7C1" id="tr2" runat="server">
                                                                        <td align="right" width="200px">
                                                                            VAT Charges:
                                                                        </td>
                                                                        <td>
                                                                            <asp:Label ID="lblVCharge" runat="server" Text="Label" Style="font-family: Rupee Foradian;"></asp:Label>
                                                                        </td>
                                                                    </tr>
                                                                    <tr style="display: none; border: 1px solid white; background-color: #6F2015; color: white;
                                                                        font-size: 15px" id="tr3" runat="server">
                                                                        <td width="200px" align="right">
                                                                            Final Price :
                                                                        </td>
                                                                        <td style="font-family: Rupee Foradian">
                                                                            (`)
                                                                            <asp:Label ID="lblFinalPrice" runat="server" Text="Label" Style="font-family: Rupee Foradian;
                                                                                font-weight: bold"></asp:Label>
                                                                        </td>
                                                                    </tr>
                                                                </table>--%>
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td style="padding-top: 20px" width="700px">
                                                                <fieldset>
                                                                    <legend style="color: #054287; font-size: 15px">Notes :</legend>
                                                                    <table>
                                                                        <tr id="lblVAT" runat="server">
                                                                            <td>
                                                                                <img src="Images/bullet.jpg" height="20" width="20" />
                                                                                <asp:Label ID="lblVATi" runat="server" Text="VAT will be charged extra"></asp:Label>
                                                                            </td>
                                                                        </tr>
                                                                        <tr id="lblAdvance" runat="server">
                                                                            <td>
                                                                                <img src="Images/bullet.jpg" height="20" width="20" />
                                                                                <asp:Label ID="lblAdvancei" runat="server" Text="50% Advance with P.O. and balance on delivery"></asp:Label>
                                                                            </td>
                                                                        </tr>
                                                                        <tr id="lbldelivery" runat="server">
                                                                            <td>
                                                                                <img src="Images/bullet.jpg" height="20" width="20" />
                                                                                <asp:Label ID="lbldeliveryi" runat="server" Text="Delivery Charges Will be Extra."></asp:Label>
                                                                                <%--<asp:CheckBox ID="chkDelivaryCharge" runat="server" Checked="true" 
                                                                    Text="" />--%>
                                                                            </td>
                                                                        </tr>
                                                                        <tr id="urgentlbl" runat="server">
                                                                            <td>
                                                                                <img src="Images/bullet.jpg" height="20" width="20" />
                                                                                <asp:Label ID="urgentlbli" runat="server" Text="Delivery within 15 days from P.O."></asp:Label>
                                                                                <%--<asp:CheckBox ID="chkUrgentD" runat="server" Checked="true" 
                                                                    Text="" />--%>
                                                                            </td>
                                                                        </tr>
                                                                        <tr id="lblCheq" runat="server">
                                                                            <td>
                                                                                <img src="Images/bullet.jpg" height="20" width="20" />
                                                                                <asp:Label ID="lblCheqi" runat="server" Text="Cheque  shall be drawn in favour of <b>'Total Sporting And Fitness Solutions Pvt. Ltd.'</b>"></asp:Label>
                                                                                <%-- <asp:CheckBox ID="chkChquename" runat="server" Checked="true" 
                                                                    Text="Cheque  shall be drawn in favour of 'Total Sporting And Fitness Solutions Pvt. Ltd." />
                                                                                --%>
                                                                            </td>
                                                                        </tr>
                                                                        <tr id="lblvalidityquote" runat="server">
                                                                            <td>
                                                                                <img src="Images/bullet.jpg" height="20" width="20" />
                                                                                <asp:Label ID="lblvalidityquotei" runat="server" Text="Validity of Quotation is 30 Days."></asp:Label>
                                                                                <%-- <asp:CheckBox ID="chkValidity" runat="server" Checked="true" 
                                                                    Text="Validity of Quotation is 30 Days." />--%>
                                                                            </td>
                                                                        </tr>
                                                                        <tr id="lbloctroi" runat="server">
                                                                            <td>
                                                                                <img src="Images/bullet.jpg" height="20" width="20" />
                                                                                <asp:Label ID="lbloctroii" runat="server" Text="All prices quoted are Ex-Works, freight, insurance,octroi, taxes and levies will be charged extra as applicable."></asp:Label>
                                                                                <%--<asp:CheckBox ID="chkoctroi" runat="server" Checked="true" 
                                                                    Text="All prices quoted are Ex-Works, freight, insurance,octroi, taxes and levies will be charged extra as applicable." />
                                                                                --%>
                                                                            </td>
                                                                        </tr>
                                                                    </table>
                                                                </fieldset>
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td align="right" colspan="2" style="padding-top: 30px; padding-bottom: 30px">
                                                                <asp:Button ID="btnPrintInvoice" runat="server" OnClick="btnPrintInvoice_Click2"
                                                                    Text="Send Invoice" />
                                                            </td>
                                                        </tr>
                                                    </table>
                                                </ContentTemplate>
                                            </asp:UpdatePanel>
                                        </asp:Panel>
                                    </td>
                                </tr>
                            </table>
                        </ContentTemplate>
                    </asp:UpdatePanel>
                </td>
            </tr>
        </table>
    </center>
    </form>
</body>
</html>
